/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package idea.sfo.viewer.utilites;


import idea.sfo.viewer.Canvas;
import java.awt.event.MouseEvent;
import java.awt.event.MouseWheelEvent;
import java.awt.event.MouseWheelListener;
import javax.swing.event.MouseInputListener;


/**
 *
 * @author renke002
 */
public class MouseManager implements MouseInputListener , MouseWheelListener
{

    /**
     *
     */
    private Canvas myCanvas;
    /**
     * Instance of the toolbar object lets us update the mouse coordinates
     * label.
     */
    private ToolBar myToolBar;


    /**
     *
     * @param jtb
     */
    public MouseManager( ToolBar jtb , Canvas canvas )
    {
        this.myCanvas = canvas;
        this.myToolBar = jtb;
    }


    /**
     *
     * @param me
     */
    @Override
    public void mouseClicked( MouseEvent me )
    {
        int x = me.getX();
        int y = me.getY();
        //
        this.myCanvas.mouseClick( x , y );
    }


    /**
     *
     * @param me
     */
    @Override
    public void mouseDragged( MouseEvent me )
    {
        System.out.println( "In org.idea.utils.sfo.MouseManager : " + me );
        //this.myCanvas.mouseDragged();
    }


    /**
     *
     * @param me
     */
    @Override
    public void mouseEntered( MouseEvent me )
    {
        System.out.println( "In org.idea.utils.sfo.MouseManager : " + me );
    }


    /**
     *
     * @param me
     */
    @Override
    public void mouseExited( MouseEvent me )
    {
        System.out.println( "In org.idea.utils.sfo.MouseManager : " + me );
    }


    /**
     *
     * @param me
     */
    @Override
    public void mouseMoved( MouseEvent me )
    {
        int mouseAtX = me.getX();
        int mouseAtY = me.getY();

        this.myToolBar.setMouseCoords( mouseAtX , mouseAtY );
    }


    /**
     *
     * @param me
     */
    @Override
    public void mousePressed( MouseEvent me )
    {
        System.out.println( "In org.idea.utils.sfo.MouseManager : " + me );
    }


    /**
     *
     * @param me
     */
    @Override
    public void mouseReleased( MouseEvent me )
    {
        System.out.println( "In org.idea.utils.sfo.MouseManager : " + me );
    }


    /**
     *
     * @param me
     */
    @Override
    public void mouseWheelMoved( MouseWheelEvent me )
    {
        System.out.println( "In org.idea.utils.sfo.MouseManager : " + me );
    }

}
